<div id="wrap">
    <div>
        <div id='upload_form'>
            <?= Form::open( null, array( 'enctype' => 'multipart/form-data' )); ?>

            <?= Form::label('userfile', 'Choose image:'); ?>
            <div class="clear"></div>
            <?= Form::file('userfile'); ?>
            <div class="clear"></div>

            <?= Form::label('description', 'Add some description:'); ?>
            <div class="clear"></div>
            <?= Form::textarea('description'); ?>
            <div class="clear"></div>

            <?= Form::submit('submit', 'Upload'); ?>

            <?= Form::close(); ?>
        </div>
    </div>

    <ul id="gallery">

        <?
            if (count($images) > 0) :
                foreach ($images as $image) :
        ?>
                    <li>
                        <div class='gallery_item'>
                            <a href="<?= URL::site('/'.$upload_original.'/'.$image->original_name); ?>" rel="gallery"  class="pirobox_gall" title="<?= $image->description; ?>">
                                <?= HTML::image($upload_thumbs.'/'.$image->thumbnail_name); ?>
                            </a>
                        </div>
                    </li>
        <?
                endforeach;
            endif;
        ?>

    </ul>
</div>